package com.example.easybuy.dao;

import com.example.easybuy.pojo.News;
import com.example.easybuy.pojo.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface NewsDao {

    /*
    查询新闻前五条
     */
    public List<News> getNewsFive(Page page);

    /*
    查询全部新闻
     */
    public int getNewsAll();

    /*
    根据id查询新闻
     */
    public News getNewsOne(@Param("id")String id);

    /*
    根据id删除新闻
     */
    public int deletNews(@Param("id")String id);

    /*
    添加新闻
     */
    public int addNews(News news);

    /*
    根据id修改新闻
     */
    public int modifyNews(News news);

}
